import Vue from 'vue';
import Router from 'vue-router';


const PL = () => import(/* webpackChunkName: "public.page" */ '@layout/Public/index.vue');
const Goods = () => import(/* webpackChunkName: "goods.page" */ '@pages/Goods/index.vue');
const Login = () => import(/* webpackChunkName: "login.page" */ '@pages/Login/index.vue');
const Cart = () => import(/* webpackChunkName: "cart.page" */ '@pages/Cart/index.vue');
const Test = () => import(/* webpackChunkName: "test.page" */ '@pages/Test/index.vue');
Vue.use(Router);

const routes = [ {
    path: '/',
    name: 'login',
    component: Login
}, {
    path: '/pl',
    component: PL,
    children: [{
        path: '/pl/goods',
        name: 'pl-goods',
        component: Goods
    }, {
        path: '/pl/cart',
        name: 'pl-cart',
        component: Cart
    }, {
        path: '',
        redirect: '/pl/goods'
    }]
}, {
    path: '/test',
    name: 'dev_test',
    component: Test
}, {
    path: '*',
    redirect: '/'
}];


export default new Router({
    mode: 'hash',
    routes
});
